﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace MySSO.Core.Repository
{
    public abstract class BaseRepository
    {
        /// <summary>
        /// 连接Acadsoc.COM.CN数据库
        /// </summary>
        /// <returns></returns>
        protected SqlConnection GetConnection()
        {
            ConfigConnectionString.Initialize();
            return new SqlConnection(ConfigConnectionString.AcadsocConnectionString);
        }
        /// <summary>
        /// Acadsoc.COM.CN.Admin
        /// </summary>
        /// <returns></returns>
        protected SqlConnection GetAdminConnection()
        {
            ConfigConnectionString.Initialize();
            return new SqlConnection(ConfigConnectionString.AcadsocAdminConnectionString);
        }
        /// <summary>
        /// Acadsoc.COM.CN.AdminVistit
        /// </summary>
        /// <returns></returns>
        protected SqlConnection GetVisitConnection()
        {
            ConfigConnectionString.Initialize();
            return new SqlConnection(ConfigConnectionString.AcadsocVisitConnectionString);
        }
    }
}

